package cn.gson.crm.model.mapper;

import cn.gson.crm.model.pojos.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface CustomerMapper {
    //customer:查询所有
    public List<Customer> select(Customer customer);

    //中国地图
    public List<Customer> mapCustomer();

    //customer:删除,把客户修改为失效客户
    public int updateDelete(@Param("customerDele") String customerDele, @Param("customerId") int customerId);

    //联系人查询是否有合同
    public Linkman linkmanContract(@Param("linkId") int linkId);

    //customer:查询出所有的负责人
    public List<Employee> selectEmp(@Param("ygId") int ygId);

    //customer:查询出所有的负责人
    public List<Employee> selectEmpCustomer(@Param("ygId") int ygId);

    //cusUpdate:客户信息查询所有:yg_id不为空
    public List<Customer> selectUpdate(@Param("ygId") int ygId,@Param("customerDele") String customerDele, @Param("customerName") String customerName, @Param("customerType") String customerType);

    //detailed:根据客户id查询联系人
    //linkman:根据客户/负责人/联系人查询联系人
    public List<Linkman> selectLinkman(@Param("ygId") int ygId,@Param("customerId") int customerId, @Param("linkName") String linkName);

    //detailed:根据客户id查询负责人
    public List<Customer> selectYname(@Param("customerId") int customerId);

    //linkman:删除联系人
    public void deleteLink(@Param("linkId") int linkId);

    //meger:根据负责人id或者客户名称或者客户名称字母
    public List<Customer> selectMeger(@Param("ygId") int ygId, @Param("customerName") String customerName);

    //时间线：销售机会
    public List<Sales> timesSales(@Param("customerId") int customerId);

    public Employee selectem(@Param("yid") int yid);

    //时间线：跟进记录
    public List<Follow> timesFollow(@Param("customerId") int customerId, @Param("followId") int followId);

    //时间线：订单
    public List<Order> timesOrder(@Param("customerId") int customerId, @Param("orderId") int orderId);

    //时间线：合同
    public List<Contract> timesContract(@Param("customerId") int customerId, @Param("contractId") int contractId);

    //时间线：回款计划
    public List<MoneyBackPlan> timesMoney(@Param("customerId") int customerId, @Param("backId") int backId);

    //时间线：回款记录
    public List<RefundRecord> timesRefund(@Param("customerId") int customerId, @Param("refundId") int refundId);

    //时间线：退货
    public List<ReturnGoods> timesReturn(@Param("customerId") int customerId, @Param("returnId") int returnId);

    //时间线：换货
    public List<ExchangeGoods> timesExchange(@Param("customerId") int customerId, @Param("excId") int excId);

    //时间线：交付计划
    public List<DeliveryPlan> timesPlan(@Param("customerId") int customerId, @Param("planId") int planId);

    //时间线：竞争对手
    public List<Competitor> timesCompetitor(@Param("customerId") int customerId, @Param("comId") int comId);

    //时间线：报价
    public List<Offer> timesOffer(@Param("customerId") int customerId, @Param("offerId") int offerId);

    //时间线：解决方案
    public List<Solution> timesSolution(@Param("customerId") int customerId, @Param("solutionId") int solutionId);

    //时间线：维修工单
    public List<RepairOrder> timesRepair(@Param("customerId") int customerId, @Param("repairId") int repairId);

    //时间线：客户投诉
    public List<Complaints> timesComplaints(@Param("customerId") int customerId, @Param("comId") int comId);

    //时间线：客户服务
    public List<CustomerService> timesService(@Param("customerId") int customerId, @Param("cusId") int cusId);

    //时间线：所有
    public List<Times> timesAll(@Param("customerId") int customerId);

    //时间线：退换货
    public List<Times> timesGoods(@Param("customerId") int customerId);

    //时间线：回款记录与回款计划
    public List<Times> timesMoneyAll(@Param("customerId") int customerId);

    //合并查询联系人
    public List<Linkman> mergeLinkman(@Param("customerId") int customerId);

    //合并数据
    public List<Merge> mergeSelect();

    public List<Sales> detailSales(@Param("salesId") int salesId);

    //统计客户
    public  List<Shuliang> selectcustomer();
}
